package com.prezs.Javaio;

import java.io.FileInputStream;
import java.io.IOException;

public class ByteStream {
	
	public static void testFileInputStream() throws IOException {
		FileInputStream fis = new FileInputStream("input.txt");
		
		byte[] buffer = new byte[16];
		int count = 0;
		
		while((count = fis.read(buffer)) != -1) {
			System.out.println(count);
			System.out.println(new String(buffer,0,count));
		}
		
		fis.close();
 		
	}
	
	public static void main(String[] args) throws IOException {
		testFileInputStream();
	}
}
